package com.ruoyi.training.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.training.mapper.TrainingResourceMonitorMapper;
import com.ruoyi.training.domain.TrainingResourceMonitor;
import com.ruoyi.training.service.ITrainingResourceMonitorService;

/**
 * 实训资源监控Service业务层处理
 * 
 * @author rocc
 * @date 2025-06-12
 */
@Service
public class TrainingResourceMonitorServiceImpl implements ITrainingResourceMonitorService 
{
    @Autowired
    private TrainingResourceMonitorMapper trainingResourceMonitorMapper;

    /**
     * 查询实训资源监控
     * 
     * @param id 实训资源监控主键
     * @return 实训资源监控
     */
    @Override
    public TrainingResourceMonitor selectTrainingResourceMonitorById(Long id)
    {
        return trainingResourceMonitorMapper.selectTrainingResourceMonitorById(id);
    }

    /**
     * 查询实训资源监控列表
     * 
     * @param trainingResourceMonitor 实训资源监控
     * @return 实训资源监控
     */
    @Override
    public List<TrainingResourceMonitor> selectTrainingResourceMonitorList(TrainingResourceMonitor trainingResourceMonitor)
    {
        return trainingResourceMonitorMapper.selectTrainingResourceMonitorList(trainingResourceMonitor);
    }

    /**
     * 新增实训资源监控
     * 
     * @param trainingResourceMonitor 实训资源监控
     * @return 结果
     */
    @Override
    public int insertTrainingResourceMonitor(TrainingResourceMonitor trainingResourceMonitor)
    {
        trainingResourceMonitor.setCreateTime(DateUtils.getNowDate());
        return trainingResourceMonitorMapper.insertTrainingResourceMonitor(trainingResourceMonitor);
    }

    /**
     * 修改实训资源监控
     * 
     * @param trainingResourceMonitor 实训资源监控
     * @return 结果
     */
    @Override
    public int updateTrainingResourceMonitor(TrainingResourceMonitor trainingResourceMonitor)
    {
        trainingResourceMonitor.setUpdateTime(DateUtils.getNowDate());
        return trainingResourceMonitorMapper.updateTrainingResourceMonitor(trainingResourceMonitor);
    }

    /**
     * 批量删除实训资源监控
     * 
     * @param ids 需要删除的实训资源监控主键
     * @return 结果
     */
    @Override
    public int deleteTrainingResourceMonitorByIds(Long[] ids)
    {
        return trainingResourceMonitorMapper.deleteTrainingResourceMonitorByIds(ids);
    }

    /**
     * 删除实训资源监控信息
     * 
     * @param id 实训资源监控主键
     * @return 结果
     */
    @Override
    public int deleteTrainingResourceMonitorById(Long id)
    {
        return trainingResourceMonitorMapper.deleteTrainingResourceMonitorById(id);
    }
}
